﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ERR
/// </summary>
public sealed class ERR
{
    public static void Handler(Exception ex, string Function = "Other", string Params = "None")
    {
        try
        {
            bool retval = DAL.InsertError(Params, ex.Message.ToString(), Function);
            if (!retval)
            {
                throw new UIException("Error in logging");
            }

        }
        catch (Exception)
        {

            throw;
        }
    }

    public class UIException : System.Exception
    {
        // The default constructor needs to be defined
        // explicitly now since it would be gone otherwise.

        public UIException()
        {

        }

        public UIException(string message)
            : base(message)
        {
        }
    }
}